View programming (2): invalidate () in the blog, I talked about the loading time of the ondraw () method of the view and the role of the invalidate () method.
In fact, it is far less simple than you think. To write this blog, let's talk about it with examples.
Package mark. zhang; import android. app. activity; import android. content. context; import android. graphics. canvas; import android. graphics. paint; import android. graphics. rectf; import android. OS. bundle; import android. util. lo
is argb[i] = (number (Argb[i] 0X00FFFFFF) Set the A-channel of the pixel at point I to 0, and then (numThe second way of thinking:Example code: Class Drawcanvas extends View {public Drawcanvas (context context) { super (context); } @Override protected void OnDraw (canvas canvas) { super.ondraw (canvas); Get resource picture of Bitmap Bitmap vbitmap = Bitmapfactory.decoderesource (This.getresources ()
available, fixed the link two errors. The range of number is 0-100,0, which means that it is completely transparent and completely invisible. One of the most critical steps you can see is argb[i] = (number The second way of thinking:Example code: classDrawcanvas extends View { PublicDrawcanvas (Context context) {super (context); } @Overrideprotected voidOnDraw (canvas canvas) {super.ondraw (canvas); //get the bitmap of resource picturesBitmap Vbitmap = Bitmapfactory.decoderesource ( This. Ge
, Xyz,tiff. I chose the binary format of the grid-registered version. Download: Http://www.ngdc.noaa.gov/mgg/global/relief/ETOPO1/data/ice_surface/grid_registered/binary/etopo1_ice_g_i2.zipextract. Bin is a binary network file,. HDR is the header filecopy the. bin to/usr/local/gmt-4.5.9/share/dbase:sudo cp etopo1_ice_g_i2.bin/usr/local/gmt-4.5.9/share/dbaseModify Grdraster.info:9 "ETOPO1 Ice Surface" "M"-r-180/180/-90/90-i1m GG I 1 0-32768 etopo1_ice_g_i2.bin LSimilarly, for bedrock version of g
Contact Us
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.